package cn.getech.data.development.entity.permission;

import cn.getech.data.development.entity.ConfConnect;
import lombok.Data;

/**
 * <p>
 * 配置连接表
 * </p>
 *
 * @author zenith
 * @since 2018-08-22
 */
@Data
public class ConfConnectPermission extends  SysRoleDataPermission{

    /**
     * 连接名称
     */
    private String name;

    /**
     * 部门id
     */
    private String departmentId;
    /**
     * 部门名称
     */
    private String departmentName;

    public ConfConnectPermission() {
    }


    public ConfConnectPermission(ConfConnect record, SysRoleDataPermission sysRoleDataPermission) {
        if (record != null) {
            setDepartmentId(record.getDepartmentId());
            setName(record.getName());
            setDepartmentName(record.getDepartmentName());
            setDataId(record.getId());
        }
        if (sysRoleDataPermission != null) {
            setQuery(sysRoleDataPermission.getQuery());
            setCreate(sysRoleDataPermission.getCreate());
            setUpdate(sysRoleDataPermission.getUpdate());
            setDelete(sysRoleDataPermission.getDelete());
            setAssign(sysRoleDataPermission.getAssign());
            setDecrypt(sysRoleDataPermission.getDecrypt());
            setExport(sysRoleDataPermission.getExport());
            setRoleId(sysRoleDataPermission.getRoleId());
            setDataType(sysRoleDataPermission.getDataType());
            setId(sysRoleDataPermission.getId());
        }
    }
}
